﻿using BussinessObject.ObjectTwo;
using Class_Entity.ObjectTwo;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ProjectHK3.Object_One
{
    public partial class NewsDetail : System.Web.UI.Page
    {
        B_Search bs = new B_Search();
        C_News ne = new C_News();
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                load();
            }
        }
        public void load()
        {
            ne = bs.loadNews(int.Parse(Session["New"].ToString()));
            TextBox1.Text = ne.TITLE;
            TextBox2.Text = ne.SUBJECT;
            FreeTextBox1.Text = ne.BODY;
            CheckBox1.Checked = ne.STATUS;
        }
        protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
        {
            TextBox1.Text = "";
            TextBox2.Text = "";
            FreeTextBox1.Text = "";
            TextBox1.Focus();
        }
    }
}